#!/bin/bash





cp /Users/Administrator/Git/repository/moco/mocobatch_bold.m ./


/Applications/MATLAB_R2024a.app/bin/matlab  -nodesktop -nosplash -r "mocobatch_bold"
#gnuplot "/Users/administrator/Git/repository/moco/gnuplot_moco_bold.txt"

rm ./Basis_*.nii ./Basis_*.mat





#NumVol=`3dinfo -nv BOLD.nii`
#echo $NumVol
#3dcalc -overwrite -prefix NoNoise_BOLD.nii  -a BOLD.nii'[0..'`expr $NumVol - 3`']'  -expr 'a'

3dMean -prefix BOLD.nii -overwrite moco*.nii*


3dRefit -TR 5.0 BOLD.nii

afni_GLM.sh BOLD.nii

3dTstat -overwrite -mean -overwrite -prefix mean_BOLD.nii BOLD.nii

start_bias_field.sh mean_BOLD.nii


3dcalc -prefix act_mask.nii -a 2_STATS_NEG_NoNoise_BOLD.nii -overwrite -expr 'step(a-4)'

LN_TRIAL -input NoNoise_BOLD.nii -trialdur 32 

afni_getTime.sh NoNoise_BOLD_TrialAverage.nii act_mask.nii

echo "und tschuess"

 
